package com.hangzhou.xyj.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.hangzhou.xyj.R;
import com.hangzhou.xyj.event.CorrectRespEvent;
import com.hangzhou.xyj.manager.IntentManager;
import com.hangzhou.xyj.model.type.ECorrectType;
import com.hangzhou.xyj.utils.EventBusUtil;

import org.greenrobot.eventbus.Subscribe;


/**
 * Created by Administrator on 2016/1/13.
 */
public class MyAuthenDialogActivity extends Activity implements View.OnClickListener {
    Button mBtProfessionAuthen;
    Button mBtGroupAuthen;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_dialog_authen);
        mBtGroupAuthen = (Button) findViewById(R.id.bt_profession_authen);
        mBtProfessionAuthen = (Button) findViewById(R.id.bt_group_authen);
        mBtGroupAuthen.setOnClickListener(this);
        mBtProfessionAuthen.setOnClickListener(this);
        EventBusUtil.register(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_group_authen:
                IntentManager.getInstance().goMyGroupAuthenActivity(this);
                break;
            case R.id.bt_profession_authen:
                IntentManager.getInstance().goMyProfessionAuthenActivity(this);
                break;
            default:
                break;
        }
    }

    @Subscribe
    public void onEventMainThread(CorrectRespEvent event) {
        switch (ECorrectType.valueOf(event.getTag())) {
            case AUTHEN:
            default:
                this.finish();
        }

    }
}
